<!DOCTYPE html>

<!--考题错误率统计-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <script src="/static/js/echarts2.0.js"></script>
</head>

<body>
    
<div id="app" v-cloak>   
        <el-row>
            <el-col span="6">
                <!-- <h3 style="margin-top:0;font-size:14px;">考试场次</h3> -->
                <div class="tree_lay">
                    <h4 class="title clearfix"><strong>区域</strong></h4>
                    <el-tree :data="TreeData" :props="defaultProps" @node-click="handleNodeClick">
                        <span slot-scope="scope">
                            <i :class="scope.data.icon"></i>
                            <template>
                                <span v-if="scope.data.icon == 'tree-open'"
                                    style="color:#12489e">{{ scope.node.label }}</span>
                                <span v-else-if="scope.data.icon == 'tree-close'"
                                    style="color: #12489e">{{ scope.node.label }}</span>
                                <span v-else>{{ scope.node.label }}</span>
                            </template>
                        </span>
                    </el-tree>
                </div>
            </el-col>
            <el-col span="18">
                <el-form label-position=" right" ref="form" :inline="true" :model="formInline" class="demo-form-inline"
                    style="margin-bottom: 15px;">
                    <el-row>
                        <el-col class="head-tool">
                            
<div class="new_title fl"><strong><img src="/static/images/icon1.png" />考题错误率统计列表</strong>
                            </div>
                            <span>
                                <btn :text="col.btnSelect" imgsrc="/static/images/search.png" linetype="3"
                                    @click="onSubmit"></btn>
                                <btn-export-list url="xxxx" :forminline="this.formInline" linetype="4">
                                </btn-export-list>
                            </span>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col span="8">
                            <div class="elst-select-mini">
                                <el-form-item>
                                    <el-input v-model="formInline.model.ExaminationName"
                                        :placeholder="ErrorRateStatisticsofExaminationQuestions.ExaminationName"
                                        size="mini">
                                        <template slot="prepend">
                                            {{ErrorRateStatisticsofExaminationQuestions.ExaminationName+mark.m}}
                                        </template>
                                    </el-input>
                                </el-form-item>
                            </div>
                        </el-col>
                        <el-col span="8">
                            <el-checkbox @input="echarts" v-model="show">
                                {{ErrorRateStatisticsofExaminationQuestions.DisplayDataReport}}
                            </el-checkbox>
                        </el-col>
                    </el-row>
                </el-form>
                <!-- <h3 style="margin-top:0;font-size:14px;">考试错误率统计</h3> -->
                <el-table v-if="!show" ref="table" stripe :data="ListItem.tableData" :row-key="getRowKeys"
                    :height="ListItem.tableHeight" border @selection-change="handleSelectionChange"
                    row-style="height:10px" style="width: 100%;height: 100%;">
                    <!-- <el-table-column type="selection" style="
        padding-top: 0px;
        padding-bottom: 0px;
    " align="center" width="55" :reserve-selection="true">
                </el-table-column> -->
                    <!-- 除第一列以外 遍历所有字段 -->
                    <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致  下同-->
                    <el-table-column type="index" :label="col.SequenceNumber" :index="indexMethod" width="50"
                        show-overflow-tooltip="true"></el-table-column>
                    <el-table-column prop="ExaminationName"
                        :label="ErrorRateStatisticsofExaminationQuestions.ExaminationName">
                    </el-table-column>
                    <el-table-column prop="Numberofanswers" width="80"
                        :label="ErrorRateStatisticsofExaminationQuestions.Numberofanswers">
                    </el-table-column>
                    <el-table-column prop="Numberoferrors" width="80"
                        :label="ErrorRateStatisticsofExaminationQuestions.Numberoferrors">
                    </el-table-column>
                    <el-table-column prop="errorrate" width="80"
                        :label="ErrorRateStatisticsofExaminationQuestions.errorrate">
                    </el-table-column>
                </el-table>
                <el-row v-if="!show" type="flex" justify="end">
                    <el-pagination ref="page" @size-change="handleSizeChange" @current-change="handleCurrentChange"
                        :current-page="ListItem.currentPage" :page-sizes="ListItem.pagesizes"
                        :page-size="ListItem.pagesize" :layout="ListItem.layout" :total="ListItem.total">
                    </el-pagination </el-row> <!--user建议替换为表名 需要与resource文件夹下js 中的对象保持一致 -->
                    <el-dialog :title="ErrorRateStatisticsofExaminationQuestions.TableName"
                        :visible.sync="ListItem.dialogVisible" @close='closeDialog' width="80%" height="80%" top="0vh">
                        <iframe ref="iframe" :src="ListItem.InputUrl" style="height:280px;width:100%"
                            frameborder="0"></iframe>
                    </el-dialog>
            </el-col>
            <el-col span="20" v-if="show">
                <div id="main4" style="height:250px"></div>
            </el-col>
        </el-row>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                show: false,
                activeClass: 'active',
                errorClass: 'text-danger',
                TreeData: [],
                mydata: treeErrorRateStatisticsofExaminationQuestionsCategoryData,

                defaultProps: {
                    children: 'children',
                    label: 'label'
                },
                ListItem: ListItem,
                sqldata: treeErrorRateStatisticsofExaminationQuestionsCategoryData,
                treeErrorRateStatisticsofExaminationQuestionsCategoryData: [],
                checked: true,
                isShow: true,
                formInline: {
                    // 遍历所有列 均为字符串即可
                    model: {
                        Name: '', Category: '', Teacher: '', LlearningTime: '', Courseware: '',
                        IsEncrypted: '', TreeNode: ''
                    },
                    offset: 0,
                    limit: 10
                }
            },
            mounted: function () {
                this.GetPageData(1);
                tablehigh(this);
                this.treeErrorRateStatisticsofExaminationQuestionsCategoryData = fn(this.sqldata, "-1");
                this.TreeData = fn(this.mydata, "0");
            },
            updated: function () {
                this.echarts()
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                handleNodeClick: function (data) {
                    if (!data.children) {
                        this.formInline.model.TreeNode = data.id
                        onSubmit(this);
                    } else {
                        if (data.icon == "tree-open") {
                            data.icon = "tree-close"
                        } else (
                            data.icon = "tree-open"
                        )
                    }
                },
                closeDialog: function () { closeDialog(this); },
                //Model 替换成 表名
                onDelete: function () { onDelete(this, '/api/ErrorRateStatisticsofExaminationQuestions/DeleteMuti'); },

                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //Model 替换成 表名
                OpenInput: function (val, id) { DialogShow(this, val, "ErrorRateStatisticsofExaminationQuestionsInput.html", id); },
                //Model 替换成 表名
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/ErrorRateStatisticsofExaminationQuestions/GetList') },

                onSubmit: function () { onSubmit(this); },

                handleSizeChange: function (val) { handleSizeChange(this, val); },

                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                echarts: function () {
                    var myChart4 = echarts.init(document.getElementById('main4'));
                    option4 = {
                        title: {
                            text: '',
                            subtext: '',
                        },
                        tooltip: {
                            trigger: 'item',
                            formatter: "{a} <br/>{b} : {c} ({d}%)"
                        },
                        legend: {
                            orient: 'vertical',
                            left: 'right',
                            data: app.mydata.legend
                        },
                        series: [
                            {
                                name: '数据来源',
                                type: 'pie',
                                radius: '75%',
                                center: ['50%', '50%'],
                                data: [
                                    { value: 335, name: '答题次数' },
                                    { value: 310, name: '错误次数' },
                                    { value: 234, name: '错误率' },
                                ],
                                itemStyle: {
                                    emphasis: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    }
                                }
                            }
                        ]
                    };
                    myChart4.setOption(option4);
                }
            }
        });
    </script>
</body>

</html>